let postApp = new Vue({
    el: "#postLabelsApp",
    data: {
        posts: [],
        pageinfo: {}
    },
    methods: {
        loadPost: function (pageNum) {
            if (!pageNum) {
                pageNum = 1;
            }
            axios({
                url: "/boke/post/labels",
                method: "get",
                params: {
                    pageNum: pageNum
                }
            }).then(function (response) {
                console.log("成功加载帖子!!!");
                console.log(response.status);
                if (response.status == 200) {
                    postApp.posts = response.data.list;
                    postApp.pageinfo = response.data;

                    //对象添加持续时间属性
                    postApp.updateDuration();
                }
            })
        },
        updateDuration:function () {
            let posts=this.posts;
            for (let i=0;i<posts.length;i++){
                addDuration(posts[i]);
            }
        }
    },
    created: function () {
        console.log("加载帖子.....")
        this.loadPost(1);
    }
})